import java.util.Scanner;
import java.util.Stack;

public class Evaluate {
    public static void main(String[] args) {
        Stack<String> ops = new Stack<>();
        Stack<Double> vals = new Stack<>();
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] str = s.split("");
        for(int i = 0;i<str.length;i++){
            if(str[i].equals("+")) ops.push(str[i]);
            else if(str[i].equals("-")) ops.push(str[i]);
            else if(str[i].equals("*")) ops.push(str[i]);
            else if(str[i].equals("/")) ops.push(str[i]);
            else if(str[i].equals("(")) continue;
            else if(str[i].equals(")")){
                double num2 = vals.pop();
                double num1 = vals.pop();
                String T = ops.pop();
                if(T.equals("+")) vals.push(num1+num2);
                else if(T.equals("-")) vals.push(num1-num2);
                else if(T.equals("*")) vals.push(num1*num2);
                else vals.push(num1/num2);
            }else{
                vals.push(Double.parseDouble(str[i]));
            }
        }
        System.out.println(vals.pop());

    }
}
